<%@page import="org.hibernate.Transaction"%>
<%@page import="org.hibernate.SQLQuery"%>
<%@page import="org.hibernate.Query"%>
<%@page import="org.hibernate.Session"%>
<%@page import="org.hibernate.SessionFactory"%>
<%@page import="org.hibernate.cfg.Configuration"%>
<%
int uid=Integer.parseInt(request.getParameter("uid"));
String pname=request.getParameter("name");
String uname=request.getParameter("uname");
String pwd=request.getParameter("pwd");
Configuration cfg=new Configuration();
cfg.configure();
SessionFactory sf=cfg.buildSessionFactory();
Session ses=sf.openSession();
Transaction tx=ses.beginTransaction();
SQLQuery query=ses.createSQLQuery("INSERT INTO  USER_1 VALUES(?,?,?,?)");
query.setInteger(0, uid);
query.setString(1, pname);
query.setString(2, uname);
query.setString(3, pwd);
int result=query.executeUpdate();
tx.commit();
if(result==1){
response.sendRedirect("/NewDon/JSP/success.jsp");
}else
response.sendRedirect("/NewDon/JSP/failuer.jsp");


 %>